package com.happystreet.mission
{
	import com.adobe.serialization.json.JSON;
	/**
	 * 任务XML模板
	 * @author Liseen
	 * 
	 */	
	public class MissionXMLTemplate extends MissionTemplate
	{
		public function MissionXMLTemplate(config:XML)
		{
			this.id = config.@id;
			this.title = config.@title;
			this.helpText = config.@help;
			this.tutoSymbolName = config.@tip_symbol;
			this.rewardType = config.@reward_type;
			this.rewardQuantity = config.@reward_quantity;
			this.rewardItemId = config.@reward_item_id;
			this.characterName = config.@character;
			this.type = config.@type;
			this.cashPrice = config.@cash_price;
			this.chapter = config.@chapter;
			this.chaptersTotal = config.@total_chapter;
			var goalsLabels:String = config.@goals_labels;
			if ((goalsLabels == null) || (goalsLabels == ""))
			{
				goalLabelTable = new Array();
			}
			else
			{
				goalLabelTable = JSON.decode(goalsLabels);
			}
			var goalsSymbols:String = config.@goals_symbols;
			if ((goalsSymbols == null)|| (goalsSymbols == ""))
			{
				goalSymbolNameTable = new Array();
			}
			else
			{
				goalSymbolNameTable = JSON.decode(goalsSymbols);
			}
			goalMaxProgressTable = JSON.decode(config.@goals_counts);
		}
	}
}